public class Text1 {
    public static boolean b = true;

    public static void main(String[] args) throws InterruptedException {
        Thread t = new Thread(()->{
            while(b){
                System.out.println("t start！");
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        });

        t.start();

        Thread.sleep(3000);
        b = false;
    }
}
